package org.luxor.commons.schedule.config.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 定时器扩展配置项
 *
 * @author Mr.Yan @date 2020/2/14
 */
@ConfigurationProperties(prefix = QuartzExtendProperties.PREFIX)
public class QuartzExtendProperties {
    public static final String PREFIX = "spring.quartz";

    private final Boolean DEFAULT_ENABLED = Boolean.TRUE;
    private final String DEFAULT_TABLE_PREFIX = "tb_sys_qrtz_";
    private final String DEFAULT_INSTANCE_NAME = "LuxorScheduler";
    private final String DEFAULT_DATASOURCE = "master";
    /**
     * 是否启用
     */
    private boolean enabled;

    /**
     * 表前缀
     */
    private String tablePrefix;

    /**
     * 持久化集群名称
     */
    private String instanceName;

    /**
     * 数据源名称
     */
    private String dataSource;

    public QuartzExtendProperties() {
        this.enabled = DEFAULT_ENABLED.booleanValue();
        this.tablePrefix = DEFAULT_TABLE_PREFIX;
        this.instanceName = DEFAULT_INSTANCE_NAME;
        this.dataSource = DEFAULT_DATASOURCE;
    }

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public String getDataSource() {
        return dataSource;
    }

    public void setDataSource(String dataSource) {
        this.dataSource = dataSource;
    }

    public String getTablePrefix() {
        return tablePrefix;
    }

    public void setTablePrefix(String tablePrefix) {
        this.tablePrefix = tablePrefix;
    }

    public String getInstanceName() {
        return instanceName;
    }

    public void setInstanceName(String instanceName) {
        this.instanceName = instanceName;
    }

}
